<?php

namespace App\Console\Commands;

use App\Models\Application;
use Illuminate\Console\Command;

class UpgradeApplicationSecret extends Command
{
    protected $signature = 'app:upgrade-application-secret';

    protected $description = '定期更新应用密钥';

    public function handle(): void
    {
        Application::where('id', '>', 0)->update([
            'app_secret' => strtoupper(md5(uniqid(rand(1, 99999)))),
        ]);
    }
}
